package com.example.demo.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.example.demo.dto.ComboDto;
import com.example.demo.mapper.ComboMapper;
import com.example.demo.service.ComboService;
import com.woniuxy.movice.entity.Combo;

@Service
@Transactional
public class ComboServiceImpl implements ComboService{
	@Resource
	private ComboMapper comboMapper;
	
	@Override
	public List<Combo> getAllCombo() {
		return comboMapper.getAllCombo();
	}

	@Override
	public List<ComboDto> getComboCount() {
		return comboMapper.getComboCount();
	}

	@Override
	public String deleteCombo(int tid) {
		if(comboMapper.deleteCombo(tid)>0) {
			return "成功";
		}else {
			return "失败";
		}
	}

	@Override
	public String addCombo(int tprice, String ttype, int tyear) {
		if(comboMapper.addCombo(tprice, ttype, tyear)>0) {
			return "成功";
		}else {
			return "失败";
		}
	}

	@Override
	public String updateCombo(int tprice, int tid) {
		if(comboMapper.updateCombo(tprice, tid)>0) {
			return "成功";
		}else {
			return "失败";
		}
	}

}
